/**
 * 
 */
package net.phoenix.repository.dao.mysql;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import net.phoenix.repository.dao.ValueTableRenameDao;

/**
 * @author lixf
 *
 */
public class MysqlValueTableRenameDao extends ValueTableRenameDao{
	/**
	 * 修改表格的名字
	 * @param tableName
	 * @param newName
	 * @throws SQLException
	 */
	public void rename(String tableName, String newName) throws SQLException {
		String query = "RENAME TABLE `"+ tableName + "` TO `"+ newName + "`";
		PreparedStatement command = null;
		try {
			command = connection.prepareStatement(query);
			command.executeUpdate();
		} finally {
			this.close(command);
		}
	}
}
